package org.ufinity.hsms.module.device.entity;

import java.io.Serializable;
import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class HostEntity implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	//
	private String host;
	//主机名
	private String hostid;
	//组id
	private String status;

	public HostEntity(JSONObject json) {
		if (json != null) {
			try {
				host = json.getString("host");
				hostid = json.getString("hostid");
				status = json.getString("status");
			} catch (JSONException jsone) {
				
			}
		}
	}
	
	public static ArrayList<HostEntity> getList(String sendRequest)
			throws JSONException {
		ArrayList<HostEntity> list = null;
		JSONArray jsonArray = new JSONArray(sendRequest);
		if (jsonArray != null && jsonArray.length() >= 0) {
			int length = jsonArray.length();
			list = new ArrayList<HostEntity>(length);
			for (int i = 0; i < length; i++) {
				list.add(new HostEntity(jsonArray.getJSONObject(i)));
			}
		}
		return list;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public String getHostid() {
		return hostid;
	}

	public void setHostid(String hostid) {
		this.hostid = hostid;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	

	
}
